Integrand size = 27, antiderivative size = 322 \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=-\frac {2 a b \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-2+n p),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac {a^2 \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-3+n p),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac {b^2 \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-1+n p),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f} \]
[Out]
Time = 0.63 (sec) , antiderivative size = 322, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {4033, 3954, 2903, 3268, 440} \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=-\frac {2 a b \sin (e+f x) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (n p-2),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {a^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (n p-3),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac {b^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (n p-1),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2} \]
[In]
[Out]
Rule 440
Rule 2903
Rule 3268
Rule 3954
Rule 4033
Rubi steps \begin{align*} \text {integral}& = \left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {(d \sec (e+f x))^{n p}}{(a+b \sec (e+f x))^2} \, dx \\ & = \left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{2-n p}(e+f x)}{(b+a \cos (e+f x))^2} \, dx \\ & = \left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac {b^2 \cos ^{2-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2}-\frac {2 a b \cos ^{3-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2}+\frac {a^2 \cos ^{4-n p}(e+f x)}{\left (-b^2+a^2 \cos ^2(e+f x)\right )^2}\right ) \, dx \\ & = \left (a^2 \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{4-n p}(e+f x)}{\left (-b^2+a^2 \cos ^2(e+f x)\right )^2} \, dx-\left (2 a b \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{3-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2} \, dx+\left (b^2 \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac {\cos ^{2-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2} \, dx \\ & = -\frac {\left (2 a b \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (2-n p)}}{\left (-a^2+b^2+a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}+\frac {\left (a^2 \cos ^{n p+2 \left (\frac {1}{2}-\frac {n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac {1}{2}+\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (3-n p)}}{\left (a^2-b^2-a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}+\frac {\left (b^2 \cos ^{n p+2 \left (\frac {1}{2}-\frac {n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac {1}{2}+\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (1-n p)}}{\left (-a^2+b^2+a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f} \\ & = -\frac {2 a b \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-2+n p),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac {n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac {a^2 \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-3+n p),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac {b^2 \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-1+n p),2,\frac {3}{2},\sin ^2(e+f x),\frac {a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac {1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(14108\) vs. \(2(322)=644\).
Time = 46.81 (sec) , antiderivative size = 14108, normalized size of antiderivative = 43.81 \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=\text {Result too large to show} \]
[In]
[Out]
\[\int \frac {\left (c \left (d \sec \left (f x +e \right )\right )^{p}\right )^{n}}{\left (a +b \sec \left (f x +e \right )\right )^{2}}d x\]
[In]
[Out]
\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=\int { \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{{\left (b \sec \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=\int \frac {\left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n}}{\left (a + b \sec {\left (e + f x \right )}\right )^{2}}\, dx \]
[In]
[Out]
\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=\int { \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{{\left (b \sec \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=\int { \frac {\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{{\left (b \sec \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx=\int \frac {{\left (c\,{\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^p\right )}^n}{{\left (a+\frac {b}{\cos \left (e+f\,x\right )}\right )}^2} \,d x \]
[In]
[Out]